${head}
<!DOCTYPE html>
<html>
<head>
  <base href="${r'${base}'}">	
  <meta charset="utf-8">
  <title>列表</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="${r'${base}'}/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="${r'${base}'}/css/my.css" media="all">
</head>

<body>
  	<div class="layui-form" lay-filter="LAY-form-list" style="padding: 20px 30px 0 0;">
  		<input type="hidden" name="oid" value="${r'${'}(${entityClass}.oid)!}">
  		<#list items as it>
  		<div class="layui-form-item">
			<label class="layui-form-label required">${it.c1}</label>
			<div class="layui-input-block">
				<input type="text" name="${it.c0}" value="${r'${'}(${entityClass}.${it.c0})!}" lay-verify="required" class="layui-input" placeholder="${it.c1}" />
			</div>
		</div>
		</#list>
		<#list dateList as it>
		<div class="layui-form-item">
			<label class="layui-form-label required">${it.c1}</label>
			<div class="layui-input-block">
				<input type="text" name="${it.c0}" value="${r'${'}(${entityClass}.${it.c0}?string('yyyy-MM-dd'))!}" id="${it.c0}" lay-verify="required" class="layui-input" placeholder="${it.c1}" />
			</div>
		</div>
		</#list>
		<#list beanList as it>
		<div class="layui-form-item">
			<label class="layui-form-label required">${it.c1}</label>
			<div class="layui-input-block">
				<select name="${it.c0}" lay-verify="required" lay-search>
	    			<option value="">---请选择---</option>
	      			${r'<@combo model="'}${it.c2}">
	      				${r'<#list items as item>'}
	      					${r'<#if'} ((${entityClass}.${it.c0})!0) == item.oid>
	      						<option value="${r'${item.oid}'}" selected>${r'${item.name}'}</option>
	      					${r'<#else>'}
	      						<option value="${r'${item.oid}'}">${r'${item.name}'}</option>
	      					${r'</#if>'}  				
	      				${r'</#list>'}
	      			${r'</@combo>'}
      			</select>
			</div>
		</div>
		</#list>
		<#list dictList as it>
		<div class="layui-form-item">
			<label class="layui-form-label required">${it.c1}</label>
			<div class="layui-input-block">
				<select name="${it.c0}" lay-verify="required" lay-search>
	    			<option value="">---请选择---</option>
	      			${r'<@dicts itemName="'}${it.c1}">
	      				${r'<#list items as item>'}
	      					${r'<#if'} ((${entityClass}.${it.c0})!0) == item.dicId>
	      						<option value="${r'${item.dicId}'}" selected>${r'${item.itemValue}'}</option>
	      					${r'<#else>'}
	      						<option value="${r'${item.dicId}'}">${r'${item.itemValue}'}</option>
	      					${r'</#if>'}  				
	      				${r'</#list>'}
	      			${r'</@dicts>'}
      			</select>
			</div>
		</div>
		</#list>
		<#list selectList as it>
		<div class="layui-form-item">
			<label class="layui-form-label required">${it.c1}</label>
			<div class="layui-input-block">
				${r'<@k.select id='}"${it.c0}" datas=${it.c2} value='${r'${'}(${entityClass}.${it.c0})!}'/>
			</div>
		</div>
		</#list>  		
	    <div class="layui-form-item layui-hide">
	      	<input type="button" lay-submit lay-filter="LAY-form-submit" id="LAY-form-submit" value="确认添加">
	      	<input type="button" lay-submit lay-filter="LAY-form-edit" id="LAY-form-edit" value="确认编辑">
	    </div>
  	</div>

  <script src="${r'${base}'}/layuiadmin/layui/layui.js"></script>
  <script>

  	layui.config({
    	base: '${r'${base}'}/layuiadmin/' //静态资源所在路径
  	}).extend({
    	index: 'lib/index',
    	jwt: '{/}${r'${base}'}/js/lib/jwt'
  	}).use(['index', 'form', 'jwt', 'laydate'], function(){
    	var $ = layui.$;
    	var form = layui.form;
    	var jwt = layui.jwt;
    	
    	<#list dateList as it>
    	layui.laydate.render({elem: '#${it.c0}'});
    	</#list>
    	
    	//监听提交
    	form.on('submit(LAY-form-submit)', function(data) {
      		var index = parent.layer.getFrameIndex(window.name);      		
      		jwt.ajax({
      			url: '${r'${base}'}/${module}/${entityPath}/save',
      			data: data.field,
      			success: function(json) {
      				parent.layui.table.reload('LAY-table');
      	      		parent.layer.close(index);
      			}
      		});
    	});
  	})
  </script>
</body>
</html>